package com.cman777.springc.mybatis.sqinjector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById;
import com.cman777.springc.mybatis.sqinjector.method.UpdateAllColumnById;

import java.util.List;

/**
 * @author chenzhicong
 * @time 2020/3/17 18:10
 * @description
 */
public class CustomMybatisPlusSqlInjector extends DefaultSqlInjector {
    /**
      * 添加mapper方法
      */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass);
        methodList.add(new UpdateAllColumnById());
        return methodList;
    }
}
